#include "widget.h"
#include "ui_widget.h"



Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    myButton = new QPushButton(this);
    myButton->setText("付豪超级帅！");

    connect(myButton,&QPushButton::clicked,this,&Widget::handleClick);
    myButton->move(300,300);
    //this->move(300,300);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::handleClick()
{
    if(myButton->text() == "付豪超级帅！")
    {
        myButton->setText("付豪无敌帅！");
    }
   else
    {
        myButton->setText("付豪超级帅！");
    }
}
